package com.steel.yfmall.cloud.assistant.user.impl;

import com.steel.yfmall.cloud.assistant.dto.para.user.ParaSendSmsInfoBean;
import com.steel.yfmall.cloud.assistant.user.SmsInfoBeanService;
import com.steel.yfmall.cloud.components.utils.base.APIMsgBean;
import com.steel.yfmall.cloud.components.utils.utils.MobileBaseBeanUtils;
import com.steel.yfmall.cloud.user.api.bean.param.APIParaSendSmsInfoBean;
import com.steel.yfmall.cloud.user.api.service.SmsInfoBeanServiceAPI;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author jia chang bao
 * @date 2021/3/1 20:00
 */
@Service
@Slf4j
public class SmsInfoBeanServiceImpl implements SmsInfoBeanService {
    @Override
    public APIMsgBean<Boolean> sendSms(ParaSendSmsInfoBean paraSendSmsInfoBean) {
        APIParaSendSmsInfoBean apiParaSendSmsInfoBean = new APIParaSendSmsInfoBean();
        MobileBaseBeanUtils.copyAllFields(paraSendSmsInfoBean, apiParaSendSmsInfoBean);
        return smsInfoBeanServiceAPI.sendSmsInfoByParam(apiParaSendSmsInfoBean);
    }

    /**
     * 短信服务
     */
    @Resource
    private SmsInfoBeanServiceAPI smsInfoBeanServiceAPI;
}
